using System;
using System.Collections.Generic;
using FireStarterModeller.BO;
using FireStarterModeller.Logic.Wizards;
using Habanero.Faces.Base;

namespace FireStarterModeller.UI.Wizards
{
    public class DeleteDMPropertyWizardController : WizardController
    {
//        private readonly CreateRelationshipWizardStep1 _step1; //Select Related Class
//        private readonly CreateRelationshipWizardStep2 _step2; //Step Only used if FK in Owner or Related
        //Class does not have matching Foreign key props. User can select Cardinality of Rel and whether to 
        // Create related props or not.
//        private readonly CreateRelationshipWizardStep3 _step3; //Confirm what has been done for the
        // relationship.
//        private readonly CreateRelationshipWizardStep4 _step4; //Final Confirmation and any warnings.
        private readonly Stack<IWizardStep> _visitedSteps  = new Stack<IWizardStep>();
/*        private DeleteDMPropertyWizardStep1 Step1 { get; set; }
        private DeleteDMPropertyWizardStep2 Step2 { get; set; }
        private DeleteDMPropertyWizardStep3 Step3 { get; set; }*/
//        public DMRelationshipCreator RelationshipCreator { get; private set; }

        public DMProperty DMProperty { get; private set; }

        public DeleteDMPropertyWizardController(DMProperty dmProp)
        {
           if (dmProp == null) throw new ArgumentNullException("dmProp");
            DMProperty = dmProp;
            /*             Step1 = new DeleteDMPropertyWizardStep1(new DMPropertyDeleter(dmProp));
                        AddStep(Step1);

                        if (this.DMProperty.HasRelationshipsWithRelatedFK)
                        {
                            Step2 = new DeleteDMPropertyWizardStep2();
                            Step3 = new DeleteDMPropertyWizardStep3();

                            AddStep(Step2);
                            AddStep(Step3);
                        }*/
        }

        public override IWizardStep GetPreviousStep()
        {
            _visitedSteps.Pop();
            IWizardStep previousStep = _visitedSteps.Peek();
            CurrentStep = WizardSteps.IndexOf(previousStep);
            return previousStep;
        }

/*        public override void CancelWizard()
        {
            base.CancelWizard();
            this.RelationshipCreator.CancelAllEdits();
        }*/
/*
        public override IWizardStep GetNextStep()
        {
            if (CurrentStep >= WizardSteps.Count - 1)
                throw new WizardStepException("Invalid Wizard Step: " + (CurrentStep + 1));

            if (GetCurrentStep() == _step1)
            {
                if (this.RelationshipCreator.CanFindForeignKey)
                {
                    //Skip step 2 and Setup Relationship
                    CurrentStep = WizardSteps.IndexOf(_step2);
                }
            }
            IWizardStep nextStep = base.GetNextStep();
            _visitedSteps.Push(nextStep);
            return nextStep;
        }*/

    }
}